<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>管理-管理系统</title>
	<meta name="keywords" content="管理系统">
	<meta name="description" content="管理系统">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black"> 
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all">
</head>
<body>
	<div>
		<form class="layui-form">
			<div class="layui-form-item layui-elem-quote">
				<label class="layui-form-label" style="width:auto">国籍</label>
				<div class="layui-input-inline">
					<input type="text" name="NationalITy" id="NationalITy" autocomplete="off" placeholder="请输入国籍" class="layui-input">
				</div>


				
				<label class="layui-form-label" style="width:auto"></label>
				<button type="button" class="layui-btn layui-btn-primary btnSearch" lay-filter="search" lay-submit>查询</button>
<!--				<button type="button" class="layui-btn btnAdd">+ 添加</button>-->
			</div>
		</form>
		<table class="layui-hide" id="tableList" lay-filter="demo"></table>
	</div>
</body>
<script type="text/html" id="barDemo">
	<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit">编辑</a>
</script>
<script src="../../layui/layui.js" charset="utf-8"></script>
<script src="../../js/public.js" charset="utf-8"></script>
<script>
layui.use(['form','upload','layedit','laydate','table'], function(){
	var table = layui.table;
	var $ = layui.jquery;
	var upload = layui.upload;
	
    upload.render({
        elem: '#test3'
        ,url: '/user/uploadImg' //改成您自己的上传接口
        ,accept: 'file' //普通文件
        ,done: function(res){
          layer.msg('上传成功');
          if(res.code==0){
				layer.alert("上传成功",{offset:['200px','450px'],icon:6});
			}
        }
      });
	
	
	
	//加载表格
	table.render({
		elem: '#tableList'
		,url:'/teaching/queryList'
		,method:'post'
		,contentType: 'application/json'
		,cellMinWidth: 80
		,cols: [[
			{field:'gender', title: '性别', align:'center'},
			{field:'NationalITy', title: '国籍', align:'center'},
			{field:'PlaceofBirth', title: '出生地', align:'center'},
			{field:'StageID', title: '教育阶段', align:'center'},
			{field:'GradeID', title: '年级', align:'center'},
			{field:'SectionID', title: '班级', align:'center'},
			{field:'Topic', title: '学科主题', align:'center'},
			{field:'Semester', title: '学期', align:'center'},
			{field:'Relation', title: '家庭教育负责人', align:'center'},
			{field:'raisedhands', title: '课堂举手次数', align:'center'},
			{field:'VisITedResources', title: '访问资源次数', align:'center'},
			{field:'AnnouncementsView', title: '查看公告次数', align:'center'},
			{field:'Discussion', title: '参与讨论次数', align:'center'},
			{field:'ParentAnsweringSurvey', title: '家长参与调查', align:'center'},
			{field:'ParentschoolSatisfaction', title: '家长满意度', align:'center'},
			{field:'StudentAbsenceDays', title: '缺勤情况', align:'center'},
			{field:'Class', title: '成绩等级', align:'center'},
			{fixed: 'right', width:100, title: '操作', align:'center', toolbar: '#barDemo'}
		]],
		page: true
	});
	
	//重载表格
	$('.btnSearch').on('click',function(){
		table.reload('tableList',{
			page: {
				curr: 1 //重新从第 1 页开始
			},
			where: {
				NationalITy: $('#NationalITy').val()
			}
		});
	});
	
	//监听工具条
	table.on('tool', function(obj){
		var data = obj.data;
		if(obj.event === 'look'){//删除
			OpenHtml('详情',['600px','420px'],'detail.html?id='+data.id);
		} else if(obj.event === 'edit'){//编辑
			OpenHtml('编辑',['600px','420px'],'edit.html?id='+data.id);
		}else if(obj.event === 'do1'){//编辑
			UpdateTable('/user/update','post',{"id":data.id,"state":"1"},'确定?','tableList');
		}  else if(obj.event === 'del'){
			DeleteTable('/product/delete','get',{"id":data.id},'tableList');
		}
	});

	//新增账号
	$('.btnAdd').on('click',function(){
		OpenHtml('新增',['600px','420px'],'add.html');
	});
});
</script>
</html>